#!/bin/bash

# shellcheck disable=SC2009
spiderAdminPID=$(ps -ef | grep spideradmin | grep -v grep | awk '{print $2}')
# shellcheck disable=SC2006
# shellcheck disable=SC2126
# shellcheck disable=SC2034
spiderAdminNumber=`ps -ef|grep spideradmin|grep -v "grep"|wc -l`
# shellcheck disable=SC1073
# shellcheck disable=SC1072
# shellcheck disable=SC1020
if [ $spiderAdminNumber == 1]; then
  kill -9 "$spiderAdminPID"
  echo "spideradmin is stop ..."
else
  echo "spideradmin is not run ..."
fi
# shellcheck disable=SC1068
# shellcheck disable=SC2009
scrapydPID=$(ps -ef | grep 'scrapyd' | grep -v grep | awk '{print $2}')
# shellcheck disable=SC2016
# shellcheck disable=SC2006
scrapydNumber=`ps -ef|grep 'scrapyd'|grep -v grep|swk '{print $2}'`
if [ $scrapydNumber == 1 ]; then
  kill -9 $scrapydPID
  echo "scrapyd is stop ..."
else
  echo "scrapyd is not run ... "
fi




